package generator.website;

import java.util.Iterator;
import org.eclipse.emf.common.util.EList;
import website.*;

public class WebSiteDtoListFactory
{
  protected static String nl;
  public static synchronized WebSiteDtoListFactory create(String lineSeparator)
  {
    nl = lineSeparator;
    WebSiteDtoListFactory result = new WebSiteDtoListFactory();
    nl = null;
    return result;
  }

  public final String NL = nl == null ? (System.getProperties().getProperty("line.separator")) : nl;
  protected final String TEXT_1 = "package domain;" + NL + "" + NL + "import java.io.Serializable;" + NL + "import java.util.List;";
  protected final String TEXT_2 = NL + NL + "public class DtoList";
  protected final String TEXT_3 = " implements Serializable {" + NL + "" + NL + "\tprivate static final long serialVersionUID = 1L;" + NL + "\tprivate List<";
  protected final String TEXT_4 = "> ";
  protected final String TEXT_5 = "List;" + NL + "\tprivate String error;" + NL + "\t" + NL + "\tpublic List<";
  protected final String TEXT_6 = "> get";
  protected final String TEXT_7 = "List() {" + NL + "\t\treturn ";
  protected final String TEXT_8 = "List;" + NL + "\t}" + NL + "\t" + NL + "\tpublic void set";
  protected final String TEXT_9 = "List(List<";
  protected final String TEXT_10 = "> ";
  protected final String TEXT_11 = "List) {" + NL + "\t\tthis.";
  protected final String TEXT_12 = "List = ";
  protected final String TEXT_13 = "List;" + NL + "\t}" + NL + "\t" + NL + "\tpublic String getError() {" + NL + "\t\treturn error;" + NL + "\t}" + NL + "\t" + NL + "\tpublic void setError(String error) {" + NL + "\t\tthis.error = error;" + NL + "\t}" + NL + "}";

  public String generate(Object argument)
  {
    final StringBuffer stringBuffer = new StringBuffer();
    stringBuffer.append(TEXT_1);
    Entity entity = (Entity) argument;
    stringBuffer.append(TEXT_2);
    stringBuffer.append(entity.getName());
    stringBuffer.append(TEXT_3);
    stringBuffer.append(entity.getName());
    stringBuffer.append(TEXT_4);
    stringBuffer.append(entity.getName());
    stringBuffer.append(TEXT_5);
    stringBuffer.append(entity.getName());
    stringBuffer.append(TEXT_6);
    stringBuffer.append(entity.getName());
    stringBuffer.append(TEXT_7);
    stringBuffer.append(entity.getName());
    stringBuffer.append(TEXT_8);
    stringBuffer.append(entity.getName());
    stringBuffer.append(TEXT_9);
    stringBuffer.append(entity.getName());
    stringBuffer.append(TEXT_10);
    stringBuffer.append(entity.getName());
    stringBuffer.append(TEXT_11);
    stringBuffer.append(entity.getName());
    stringBuffer.append(TEXT_12);
    stringBuffer.append(entity.getName());
    stringBuffer.append(TEXT_13);
    return stringBuffer.toString();
  }
}
